/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
/**
 *
 * @author dario
 */
@NamedQueries
({
    @NamedQuery
    (
     name="Sorteos.UltimoID",
     query="SELECT max(miSorteo.id) FROM Sorteos miSorteo"
    ),
    @NamedQuery
    (
     name="Sorteos.Ultimo",
     query="SELECT miSorteo FROM Sorteos miSorteo WHERE miSorteo.id= :idUltimo "
    )

})
@Entity
public class Sorteos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Temporal (TemporalType.DATE)
    private Date Fecha;
    @Temporal (TemporalType.DATE)
    private Date FechaIn;
    @Temporal (TemporalType.DATE)
    private Date FechaFin;
    @Column (length=4)
    private int CantGan;
    @Column (length=15)
    private Long IdAdmin;

    public int getCantGan() {
        return CantGan;
    }

    public void setCantGan(int CantGan) {
        this.CantGan = CantGan;
    }

    public Date getFecha() {
        return Fecha;
    }

    public void setFecha(Date Fecha) {
        this.Fecha = Fecha;
    }

    public Date getFechaFin() {
        return FechaFin;
    }

    public void setFechaFin(Date FechaFin) {
        this.FechaFin = FechaFin;
    }

    public Date getFechaIn() {
        return FechaIn;
    }

    public void setFechaIn(Date FechaIn) {
        this.FechaIn = FechaIn;
    }

    public Long getIdAdmin() {
        return IdAdmin;
    }

    public void setIdAdmin(Long IdAdmin) {
        this.IdAdmin = IdAdmin;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sorteos)) {
            return false;
        }
        Sorteos other = (Sorteos) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entity.Sorteos[id=" + id + "]";
    }

}
